/*
 * @ author madman 
 * @ use 后台用户schema
 */
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
var shortid = require('shortid');
const AdminUserSchema = new Schema({
    _id: {
        type: String,
        'default': shortid.generate
    },
    // 管理员用户名
    username: {
        type: String,
        required: true
    },
    // 管理员密码
    password: {
        type: String,
        required: true
    },
    // 关联角色菜单
    power: {
        type: String,
        ref: 'j_admin_roles'
    },
    // 锁
    isLock: {
        type: Boolean,
        required: false
    },
    // 新建时间
    createdAt: {
        type: Date,
        default: Date.now
    },
    // 更新时间
    updataAt: {
        type: Date,
        default: Date.now
    }
});
module.exports = mongoose.model('j_admin_user', AdminUserSchema,'j_admin_user');